import request from '@/utils/request'

export function listDataSource() {
  return request({
    url: "/model/listDataSource.action",
    method: 'get'
  });
}

export function getDataSource(dsid) {
  return request({
    url: `/model/getDataSource.action?dsid=${dsid}`,
    method: 'get'
  });
}

export function deleteDataSource(dsid) {
  return request({
    url: `/model/deleteDataSource.action?dsid=${dsid}`,
    method: 'get'
  });
}

export function testDataSource(ds) {
  return request({
    url: `/model/testDataSource.action`,
    method: 'post',
    data: ds
  });
}

export function testJndi(ds) {
  return request({
    url: `/model/testJndi.action`,
    method: 'post',
    data: ds
  });
}

export function updateDataSource(ds) {
  return request({
    url: `/model/updateDataSource.action`,
    method: 'post',
    data: ds
  });
}

export function saveDataSource(ds) {
  return request({
    url: `/model/saveDataSource.action`,
    method: 'post',
    data: ds
  });
}

